/**
 * 
 */
package de.uni_leipzig.informatik.asv.unsupervised_pos_tagger.datacreation.feature_types;

/**
 * @author Christoph Teichmann
 * created Jun 3, 2014 4:28:00 PM
 * @version 0.1
 */
public class DigitFeatures extends GenericFeatureGenerator
{
	/**
	 * 
	 * @param pairs
	 * @param def
	 */
	public DigitFeatures()
	{
		super(new String[][] {{"\\p{Digit}+","ONLYNUM"},{"[^\\p{Digit}]+\\p{Digit}+","ENDNUM"},
				{"\\p{Digit}+[^\\p{Digit}]+","STARTNUM"},{"[^\\p{Digit}]+","NONUM"}}, "MIXED");
	}
	/* (non-Javadoc)
	 * @see de.uni_leipzig.informatik.asv.unsupervised_pos_tagger.datacreation.FeatureType#process(java.lang.String)
	 */
	@Override
	public String process(String s)
	{return s.replaceAll("\\d+", "1");}
	/* (non-Javadoc)
	 * @see de.uni_leipzig.informatik.asv.unsupervised_pos_tagger.datacreation.FeatureType#name()
	 */
	@Override
	public String name()
	{return "NUMFEATURES";}
}